﻿@{
    ViewBag.Title = "Upload";
}

<h2>Upload</h2>

@if (Request["error"] != null )
{
    if (Request["error"].Equals("1"))
    {
        <span>Invalid number of copy</span>
    }
    else if (Request["error"].Equals("2"))
    {
        <span>Unsupported file type</span>
    }
}

@using (Html.BeginForm("Index", "Upload", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<div style="width: 400px">
	<div style="background: #ddeeff; height: 80px">
		<div style="float: left; width: 110px; vertical-align: middle">
			File to Print<br />[acceptable file types: .pdf;.doc;.docx]
		</div>
		<div style="vertical-align: middle">
			<input type="file" name="file" />
		</div>
	</div>
	<div style="background: #aabbff; height: 120px; vertical-align: middle">
		<div style="float: left; width: 110px">
			Destination Delivery Address<br />[leave blank if using address given at registration]
		</div>
		<div style="vertical-align: middle">
			<textarea name="address" cols="30" rows="5">@if(Request["error"] != null) { @ViewBag.address }</textarea>
		</div>
	</div>
    <div style="background: #ddeeff; height: 120px; vertical-align: middle">
		<div style="float: left; width: 110px">
			Printing Description
		</div>
		<div style="vertical-align: middle">
			<textarea name="printDesc" cols="30" rows="5">@if(Request["error"] != null) { @ViewBag.printDesc }</textarea>
		</div>
	</div>
    <div style="background: #aabbff; height: 40px; vertical-align: middle">
		<div style="float: left; width: 110px">
			Paper Type
		</div>
		<div style="vertical-align: middle">
			<select name="paperType">
                <option value="plain">Plain Paper</option>
            </select>
		</div>
	</div>
    <div style="background: #ddeeff; height: 40px; vertical-align: middle">
		<div style="float: left; width: 110px">
			Paper Size
		</div>
		<div style="vertical-align: middle">
			<select name="paperSize">
                <option value="a4">A4</option>
                <option value="a5">A5</option>
            </select>
		</div>
	</div>
    <div style="background: #ddeeff; height: 40px; vertical-align: middle">
		<div style="float: left; width: 110px">
			Num. of Copy
		</div>
		<div style="vertical-align: middle">
			<input type="text" name="numCopy" @if(Request["error"] != null) { Html.Raw("value=\"" + @ViewBag.address + "\""); } />
		</div>
	</div>
    <div style="text-align: center">
        <input type="submit" value="Upload" />
    </div>
</div>
}

<p>Notes:</p>
<ol>
    <li>Currently we only support plain paper</li>
    <li>Example printing description:<br />
    <code>page 2,3,5-11</code>
    </li>
</ol>